package view.kasse;

import utility.PriceFormater;

/**
 *
 * @author Jeppe
 */
public class KasseListeSalgsRabatPanel extends javax.swing.JPanel {

    private final int rabat;
    private final int salgsPrisMedRabat;

    /**
     * Creates new form KasseListeRabatPanel
     *
     * @param enhedsSalg
     */
    public KasseListeSalgsRabatPanel(int salgetsTotalPris, int salgsPrisMedRabat, int salgsRabat) {
        initComponents();
        this.rabat = salgsRabat;
        this.salgsPrisMedRabat = salgsPrisMedRabat;
        rabatLabelPerc.setText("-" + rabat + " %");
        resultatLabel.setText(PriceFormater.formaterPrisTilString(-(salgetsTotalPris - salgsPrisMedRabat)));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        rabatLabelPerc = new javax.swing.JLabel();
        resultatLabel = new javax.swing.JLabel();

        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        setOpaque(false);
        setLayout(null);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N
        jLabel1.setText("Salgsrabat");
        add(jLabel1);
        jLabel1.setBounds(10, 16, 80, 20);

        rabatLabelPerc.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        add(rabatLabelPerc);
        rabatLabelPerc.setBounds(210, 17, 80, 20);

        resultatLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        add(resultatLabel);
        resultatLabel.setBounds(354, 17, 60, 20);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel rabatLabelPerc;
    private javax.swing.JLabel resultatLabel;
    // End of variables declaration//GEN-END:variables
}
